import com.example.demo.chap2.MainConfig3;
import org.junit.jupiter.api.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
/**
 * 测试通过Java方式进行注入
 */
@Test
void testJavaAnnotationSection01(){
    ApplicationContext context = new AnnotationConfigApplicationContext(HelloWorldConfig.class);
    HelloWorld bean = context.getBean(HelloWorld.class);
    bean.setMessage("至高之神，请垂怜我!");
    bean.display();
}
}

